package com.producerandconsumer;

public class Consumer extends Thread{
    //属性
    private MyStack stack;

    public Consumer(MyStack stack){
        this.stack = stack;
    }


    @Override
    public void run() {
        while (true){
            Object obj = stack.pop();
            if(obj == null){
                //System.out.println("消费者没有消费产品：");
            }
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
